package com.puzzlebazar.client.puzzleinfo;

import java.io.Serializable;

import com.puzzlebazar.client.util.TextUtil;

public class NewPuzzleInfo implements Serializable {
	
    /**
	 * 
	 */
	private static final long serialVersionUID = -1968533164583107935L;
	
	private String title = "";
    private String genre = "";
    private String size = "";
    private String authorEmail = null;
    private boolean tutorial = false;


	/**
	 * @return The name of this puzzle
	 */
	public String getTitle() {
		return title;
	}
	
	/**
	 * @return The genre of this puzzle
	 */
	public String getGenre() {
		return genre;
	}

	/**
	 * @return The size of this puzzle
	 */
	public String getSize() {
		return size;
	}

	/**
	 * @return The author email (a unique ID) of this puzzle
	 */
	public String getAuthorEmail() {
		return authorEmail;
	}    

	/**
	 * @return True if this puzzle is in fact a tutorial
	 */
	public boolean isTutorial() {
		return tutorial;
	}
	
	/**
	 * @param title The name to set for this puzzle
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @param genre The genre to set for this puzzle
	 */
	public void setGenre(String genre) {
		this.genre = genre;
	}

	/**
	 * @param size The size to set for this puzzle
	 */
	public void setSize(String size) {
		this.size = size;
	}

	/**
	 * @param authorEmail The author to set for that puzzle
	 */
	public void setAuthorEmail(String authorEmail) {
		this.authorEmail  = authorEmail;
	}

	/**
	 * Indicates if this puzzle is a tutorial or not
	 * 
	 * @param tutorial True if the puzzle is a tutorial
	 */
	public void setTutorial(boolean tutorial) {
		this.tutorial = tutorial;
	}

	/**
	 * Formats the genre and size of the puzzle in a string
	 * 
	 * @param useHTML True to generate HTML markup in the string
	 * @return The formatted string
	 */
	public String getGenreAndSize( boolean useHTML ) {
		return TextUtil.putInSpan(genre, "puzzle-genre", useHTML) +
			TextUtil.putInSpan(" (" + size + ")", "puzzle-size", useHTML);
	}

}
